from collections import Counter
from typing import List


class DivideArray:
    #  将数组划分成相等数对 all 所有元素必须满足条件 list使用元组构造列表
    def divideArray(self, nums: List[int]) -> bool:
        # 元素出现次数哈希表
        freq = Counter(nums)
        return all(f % 2 == 0 for f in freq.values())

    @staticmethod
    def mainDemo():
        s = DivideArray()
        nums = list((3, 2, 3, 2, 2, 2))
        print(s.divideArray(nums))
        nums2 = []
        nums2.append(3)
        nums2.append(2)
        nums2.append(3)
        nums2.append(2)
        nums2.append(2)
        nums2.append(2)
        print(s.divideArray(nums2))
        print(nums2[0:-1])
        print(nums2[:-1])
        print(nums2[-1:-1])
        print(nums2[-2:-1])
        print(nums2[0:-1:2])
        print(nums2[::2])
        print(nums2[0:])
        print(nums2[0:0])
